package com.example.bootdemo.pojo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.Objects;

@NoArgsConstructor
@AllArgsConstructor
public class UserBlogKey implements Serializable {

    @Setter
    @Getter
    private Integer createUserId;

    @Setter
    @Getter
    private String title;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserBlogKey that = (UserBlogKey) o;
        return Objects.equals(createUserId, that.createUserId) &&
                Objects.equals(title, that.title);
    }

    @Override
    public int hashCode() {
        return Objects.hash(createUserId, title);
    }
}
